﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// wx_DeviceBuy数据模型对象
    /// </summary>
    [Serializable]
    public partial class wx_DeviceBuyMod
    {
        /// <summary>
        /// 初始化wx_DeviceBuy数据模型对象
        /// </summary>
        public wx_DeviceBuyMod()
        {
            
        }
        /// <summary>
        /// 初始化wx_DeviceBuy数据模型对象并给在SQL中不能为空的字段赋值
        /// </summary>
        /// <param name="preid">preid</param>
        /// <param name="openid">openid</param>
        /// <param name="icount">icount</param>
        /// <param name="specid">specid</param>
        /// <param name="price">price</param>
        /// <param name="tamount">tamount</param>
        /// <param name="ttime">ttime</param>
        /// <param name="address">address</param>
        /// <param name="uname">uname</param>
        /// <param name="uphone">uphone</param>
        /// <param name="ostate">ostate</param>
        public wx_DeviceBuyMod(string preid,string openid,int icount,string specid,decimal price,decimal tamount,DateTime ttime,string address,string uname,string uphone,int ostate)
        {
            //给preid字段赋值
            this.Preid = preid;
            //给openid字段赋值
            this.Openid = openid;
            //给icount字段赋值
            this.Icount = icount;
            //给specid字段赋值
            this.Specid = specid;
            //给price字段赋值
            this.Price = price;
            //给tamount字段赋值
            this.Tamount = tamount;
            //给ttime字段赋值
            this.Ttime = ttime;
            //给address字段赋值
            this.Address = address;
            //给uname字段赋值
            this.Uname = uname;
            //给uphone字段赋值
            this.Uphone = uphone;
            //给ostate字段赋值
            this.Ostate = ostate;
        }
        /// <summary>
        /// 初始化wx_DeviceBuy数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="preid">preid</param>
        /// <param name="openid">openid</param>
        /// <param name="icount">icount</param>
        /// <param name="specid">specid</param>
        /// <param name="price">price</param>
        /// <param name="tamount">tamount</param>
        /// <param name="ttime">ttime</param>
        /// <param name="ctime">ctime</param>
        /// <param name="stime">stime</param>
        /// <param name="etime">etime</param>
        /// <param name="address">address</param>
        /// <param name="uname">uname</param>
        /// <param name="uphone">uphone</param>
        /// <param name="ostate">ostate</param>
        /// <param name="kdcomp">kdcomp</param>
        /// <param name="kdno">kdno</param>
        /// <param name="deviceno">deviceno</param>
        /// <param name="remark">remark</param>
        /// <param name="starttime">starttime</param>
        /// <param name="endtime">endtime</param>
        public wx_DeviceBuyMod(string preid,string openid,int icount,string specid,decimal price,decimal tamount,DateTime ttime,DateTime? ctime,DateTime? stime,DateTime? etime,string address,string uname,string uphone,int ostate,string kdcomp,string kdno,string deviceno,string remark,DateTime? starttime,DateTime? endtime)
        {
            //给preid字段赋值
            this.Preid = preid;
            //给openid字段赋值
            this.Openid = openid;
            //给icount字段赋值
            this.Icount = icount;
            //给specid字段赋值
            this.Specid = specid;
            //给price字段赋值
            this.Price = price;
            //给tamount字段赋值
            this.Tamount = tamount;
            //给ttime字段赋值
            this.Ttime = ttime;
            //给ctime字段赋值
            this.Ctime = ctime;
            //给stime字段赋值
            this.Stime = stime;
            //给etime字段赋值
            this.Etime = etime;
            //给address字段赋值
            this.Address = address;
            //给uname字段赋值
            this.Uname = uname;
            //给uphone字段赋值
            this.Uphone = uphone;
            //给ostate字段赋值
            this.Ostate = ostate;
            //给kdcomp字段赋值
            this.Kdcomp = kdcomp;
            //给kdno字段赋值
            this.Kdno = kdno;
            //给deviceno字段赋值
            this.Deviceno = deviceno;
            //给remark字段赋值
            this.Remark = remark;
            //给starttime字段赋值
            this.Starttime = starttime;
            //给endtime字段赋值
            this.Endtime = endtime;
        }
        
		//属性存储数据的变量
        private string _preid;
        private string _openid;
        private int _icount;
        private string _specid;
        private decimal _price;
        private decimal _tamount;
        private DateTime _ttime;
        private DateTime? _ctime;
        private DateTime? _stime;
        private DateTime? _etime;
        private string _address;
        private string _uname;
        private string _uphone;
        private int _ostate;
        private string _kdcomp;
        private string _kdno;
        private string _deviceno;
        private string _remark;
        private DateTime? _starttime;
        private DateTime? _endtime;
        
        /// <summary>
        /// preid
        /// </summary>
        public string Preid
        {
            get { return this._preid; }
            set { this._preid = value; }
        }
        /// <summary>
        /// openid
        /// </summary>
        public string Openid
        {
            get { return this._openid; }
            set { this._openid = value; }
        }
        /// <summary>
        /// icount
        /// </summary>
        public int Icount
        {
            get { return this._icount; }
            set { this._icount = value; }
        }
        /// <summary>
        /// specid
        /// </summary>
        public string Specid
        {
            get { return this._specid; }
            set { this._specid = value; }
        }
        /// <summary>
        /// price
        /// </summary>
        public decimal Price
        {
            get { return this._price; }
            set { this._price = value; }
        }
        /// <summary>
        /// tamount
        /// </summary>
        public decimal Tamount
        {
            get { return this._tamount; }
            set { this._tamount = value; }
        }
        /// <summary>
        /// ttime
        /// </summary>
        public DateTime Ttime
        {
            get { return this._ttime; }
            set { this._ttime = value; }
        }
        /// <summary>
        /// ctime
        /// </summary>
        public DateTime? Ctime
        {
            get { return this._ctime; }
            set { this._ctime = value; }
        }
        /// <summary>
        /// stime
        /// </summary>
        public DateTime? Stime
        {
            get { return this._stime; }
            set { this._stime = value; }
        }
        /// <summary>
        /// etime
        /// </summary>
        public DateTime? Etime
        {
            get { return this._etime; }
            set { this._etime = value; }
        }
        /// <summary>
        /// address
        /// </summary>
        public string Address
        {
            get { return this._address; }
            set { this._address = value; }
        }
        /// <summary>
        /// uname
        /// </summary>
        public string Uname
        {
            get { return this._uname; }
            set { this._uname = value; }
        }
        /// <summary>
        /// uphone
        /// </summary>
        public string Uphone
        {
            get { return this._uphone; }
            set { this._uphone = value; }
        }
        /// <summary>
        /// ostate
        /// </summary>
        public int Ostate
        {
            get { return this._ostate; }
            set { this._ostate = value; }
        }
        /// <summary>
        /// kdcomp
        /// </summary>
        public string Kdcomp
        {
            get { return this._kdcomp; }
            set { this._kdcomp = value; }
        }
        /// <summary>
        /// kdno
        /// </summary>
        public string Kdno
        {
            get { return this._kdno; }
            set { this._kdno = value; }
        }
        /// <summary>
        /// deviceno
        /// </summary>
        public string Deviceno
        {
            get { return this._deviceno; }
            set { this._deviceno = value; }
        }
        /// <summary>
        /// remark
        /// </summary>
        public string Remark
        {
            get { return this._remark; }
            set { this._remark = value; }
        }
        /// <summary>
        /// starttime
        /// </summary>
        public DateTime? Starttime
        {
            get { return this._starttime; }
            set { this._starttime = value; }
        }
        /// <summary>
        /// endtime
        /// </summary>
        public DateTime? Endtime
        {
            get { return this._endtime; }
            set { this._endtime = value; }
        }
        
        /// <summary>
        /// 对比两个wx_DeviceBuy数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的wx_DeviceBuy数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成wx_DeviceBuy数据模型对象
            wx_DeviceBuyMod wx_DeviceBuyMod = obj as wx_DeviceBuyMod;
            //判断是否转换成功
            if (wx_DeviceBuyMod == null) return false;
            //进行匹配属性的值
            return
                //判断preid是否一致
                this.Preid == wx_DeviceBuyMod.Preid &&
                //判断openid是否一致
                this.Openid == wx_DeviceBuyMod.Openid &&
                //判断icount是否一致
                this.Icount == wx_DeviceBuyMod.Icount &&
                //判断specid是否一致
                this.Specid == wx_DeviceBuyMod.Specid &&
                //判断price是否一致
                this.Price == wx_DeviceBuyMod.Price &&
                //判断tamount是否一致
                this.Tamount == wx_DeviceBuyMod.Tamount &&
                //判断ttime是否一致
                this.Ttime == wx_DeviceBuyMod.Ttime &&
                //判断ctime是否一致
                this.Ctime == wx_DeviceBuyMod.Ctime &&
                //判断stime是否一致
                this.Stime == wx_DeviceBuyMod.Stime &&
                //判断etime是否一致
                this.Etime == wx_DeviceBuyMod.Etime &&
                //判断address是否一致
                this.Address == wx_DeviceBuyMod.Address &&
                //判断uname是否一致
                this.Uname == wx_DeviceBuyMod.Uname &&
                //判断uphone是否一致
                this.Uphone == wx_DeviceBuyMod.Uphone &&
                //判断ostate是否一致
                this.Ostate == wx_DeviceBuyMod.Ostate &&
                //判断kdcomp是否一致
                this.Kdcomp == wx_DeviceBuyMod.Kdcomp &&
                //判断kdno是否一致
                this.Kdno == wx_DeviceBuyMod.Kdno &&
                //判断deviceno是否一致
                this.Deviceno == wx_DeviceBuyMod.Deviceno &&
                //判断remark是否一致
                this.Remark == wx_DeviceBuyMod.Remark &&
                //判断starttime是否一致
                this.Starttime == wx_DeviceBuyMod.Starttime &&
                //判断endtime是否一致
                this.Endtime == wx_DeviceBuyMod.Endtime;
        }
        /// <summary>
        /// 将当前wx_DeviceBuy数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将wx_DeviceBuy数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将preid进行按位异或运算处理
                (this.Preid == null ? 2147483647 : this.Preid.GetHashCode()) ^
                //将openid进行按位异或运算处理
                (this.Openid == null ? 2147483647 : this.Openid.GetHashCode()) ^
                //将icount进行按位异或运算处理
                this.Icount.GetHashCode() ^
                //将specid进行按位异或运算处理
                (this.Specid == null ? 2147483647 : this.Specid.GetHashCode()) ^
                //将price进行按位异或运算处理
                this.Price.GetHashCode() ^
                //将tamount进行按位异或运算处理
                this.Tamount.GetHashCode() ^
                //将ttime进行按位异或运算处理
                this.Ttime.GetHashCode() ^
                //将ctime进行按位异或运算处理
                (this.Ctime == null ? 2147483647 : this.Ctime.GetHashCode()) ^
                //将stime进行按位异或运算处理
                (this.Stime == null ? 2147483647 : this.Stime.GetHashCode()) ^
                //将etime进行按位异或运算处理
                (this.Etime == null ? 2147483647 : this.Etime.GetHashCode()) ^
                //将address进行按位异或运算处理
                (this.Address == null ? 2147483647 : this.Address.GetHashCode()) ^
                //将uname进行按位异或运算处理
                (this.Uname == null ? 2147483647 : this.Uname.GetHashCode()) ^
                //将uphone进行按位异或运算处理
                (this.Uphone == null ? 2147483647 : this.Uphone.GetHashCode()) ^
                //将ostate进行按位异或运算处理
                this.Ostate.GetHashCode() ^
                //将kdcomp进行按位异或运算处理
                (this.Kdcomp == null ? 2147483647 : this.Kdcomp.GetHashCode()) ^
                //将kdno进行按位异或运算处理
                (this.Kdno == null ? 2147483647 : this.Kdno.GetHashCode()) ^
                //将deviceno进行按位异或运算处理
                (this.Deviceno == null ? 2147483647 : this.Deviceno.GetHashCode()) ^
                //将remark进行按位异或运算处理
                (this.Remark == null ? 2147483647 : this.Remark.GetHashCode()) ^
                //将starttime进行按位异或运算处理
                (this.Starttime == null ? 2147483647 : this.Starttime.GetHashCode()) ^
                //将endtime进行按位异或运算处理
                (this.Endtime == null ? 2147483647 : this.Endtime.GetHashCode());
        }
        /// <summary>
        /// 将当前wx_DeviceBuy数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前wx_DeviceBuy数据模型对象转换成字符串副本
            return
                "[" +
                //将preid转换成字符串
                this.Preid + "," +
                //将openid转换成字符串
                this.Openid + "," +
                //将icount转换成字符串
                this.Icount + "," +
                //将specid转换成字符串
                this.Specid + "," +
                //将price转换成字符串
                this.Price + "," +
                //将tamount转换成字符串
                this.Tamount + "," +
                //将ttime转换成字符串
                this.Ttime + "," +
                //将address转换成字符串
                this.Address + "," +
                //将uname转换成字符串
                this.Uname + "," +
                //将uphone转换成字符串
                this.Uphone + "," +
                //将ostate转换成字符串
                this.Ostate +
                "]";
        }
    }
}
